import Vue from 'vue'
import App from './App.vue'
import "bootstrap/dist/css/bootstrap.css"
import "./assets/fonts/iconfont.css"

import axios from "axios";
axios.defaults.baseURL = "https://www.escook.cn";

Vue.directive("focus", {
  inserted(el){
    el.focus()
  }
})

import VueRouter from 'vue-router'
import MyGoodsList from './views/MyGoodsList'
import MyGoodsSearch from './views/MyGoodsSearch'
import MyUserInfo from './views/MyUserInfo'

Vue.config.productionTip = false
Vue.use(VueRouter)



const routes = [
  {
    path:'/MyGoodsList',
    name:'MyGoodsList',
    component:MyGoodsList
  },
  {
    path:'/MyGoodsSearch',
    name:'MyGoodsSearch',
    component:MyGoodsSearch
  },
  {
    path:'/MyUserInfo',
    name:'MyUserInfo',
    component:MyUserInfo
  }
]


const router = new VueRouter({
  routes
})

new Vue({
  router,
  render: h => h(App),
}).$mount('#app')

// const routerPush = VueRouter.prototype.push
// VueRouter.prototype.push = function (location, onComplete, onAbort) {
//   return routerPush.call(this, location, onComplete, onAbort).catch(err => {
//     if(!/^NavigationDuplicated/.test(err)) {
//       console.log(err);
//     }
//   })



// }
